Skip to content

fix: surface statement-level query errors and fix debug-mode crash#451

Open
MagnunAVFAzion wants to merge 4 commits into
mainfrom
fix/sql-surface-query-statement-errors
Open

fix: surface statement-level query errors and fix debug-mode crash#451
MagnunAVFAzion wants to merge 4 commits into
mainfrom
fix/sql-surface-query-statement-errors

Conversation

@MagnunAVFAzion

@MagnunAVFAzion MagnunAVFAzion commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

What

Hardens error handling in the SQL package's postQueryDatabase:

  1. Fixes a crash in debug mode. When the SQL API returned a per-statement
    result array containing a null entry (e.g. [{ error: 'no such table: ...' }, null]),
    the debug .map() accessed .results on null and threw
    Cannot read properties of null (reading 'results').

  2. Surfaces statement-level errors. The API reports per-statement failures
    inside the data array rather than in top-level result.errors. These are
    now detected and returned as a proper error object, instead of being buried
    in the response data.

  3. Updates docs to make the "check error before data" behavior explicit.

Problem Reproduction

Running a query (in localhost - nodejs server) against a non-existent table with debug true produced:

[TypeError: Cannot read properties of null (reading 'results')]

instead of a clean error response.

@MagnunAVFAzion MagnunAVFAzion requested review from a team and jcbsfilho as code owners July 2, 2026 15:19
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

SCC Complexity Analysis

  • Title: fix(sql): surface statement-level query errors and fix debug-mode crash
  • Author: MagnunAVFAzion
Metric Source Branch (fix/sql-surface-query-statement-errors) Target Branch (main) Difference
Complexity 2458 2454 4
Code 50653 50637 16

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

SCC Complexity Analysis

  • Title: fix(sql): surface statement-level query errors and fix debug-mode crash
  • Author: MagnunAVFAzion
Metric Source Branch (fix/sql-surface-query-statement-errors) Target Branch (main) Difference
Complexity 2458 2454 4
Code 50638 50637 1

@MagnunAVFAzion MagnunAVFAzion changed the title fix(sql): surface statement-level query errors and fix debug-mode crash fix: surface statement-level query errors and fix debug-mode crash Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

SCC Complexity Analysis

  • Title: fix: surface statement-level query errors and fix debug-mode crash
  • Author: MagnunAVFAzion
Metric Source Branch (fix/sql-surface-query-statement-errors) Target Branch (main) Difference
Complexity 2458 2454 4
Code 50642 50637 5

@pkg-pr-new

pkg-pr-new Bot commented Jul 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/aziontech/lib/@aziontech/sql@451

commit: 144a225

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants